<html>
<head><meta charset="utf-8"><title>bad error recovery for use statements with curlies · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/bad.20error.20recovery.20for.20use.20statements.20with.20curlies.html">bad error recovery for use statements with curlies</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222955037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/bad%20error%20recovery%20for%20use%20statements%20with%20curlies/near/222955037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/bad.20error.20recovery.20for.20use.20statements.20with.20curlies.html#222955037">(Jan 16 2021 at 03:10)</a>:</h4>
<p>something such as <code>use crate::{</code> seems to have really bad error recovery overall, it flags nearly every single token in the file as an error. Has this been investigated before? I can try implementing better recovery if its doable since i know the parser pretty well.</p>



<a name="222968137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/bad%20error%20recovery%20for%20use%20statements%20with%20curlies/near/222968137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/bad.20error.20recovery.20for.20use.20statements.20with.20curlies.html#222968137">(Jan 16 2021 at 08:06)</a>:</h4>
<p>See <a href="https://github.com/rust-analyzer/rust-analyzer/pull/4680">https://github.com/rust-analyzer/rust-analyzer/pull/4680</a></p>



<a name="222971338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/bad%20error%20recovery%20for%20use%20statements%20with%20curlies/near/222971338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/bad.20error.20recovery.20for.20use.20statements.20with.20curlies.html#222971338">(Jan 16 2021 at 09:25)</a>:</h4>
<p>I have been thinking if the lexer can insert one or more fake <code>}</code> token when it finds a keyword that is not allowed inside a <code>use</code> item The lexer can assume that a <code>use</code> item starts at the <code>use</code> keyword and ends at <code>;</code> or when all <code>{</code> have been closed.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>